package com.hyacinth.forumbite.dao;

import com.hyacinth.forumbite.model.Article;
import com.hyacinth.forumbite.model.Like;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ArticleMapper {
    int insert(Article row);

    int insertSelective(Article row);

    Article selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Article row);

    int updateByPrimaryKeyWithBLOBs(Article row);

    int updateByPrimaryKey(Article row);

    List<Article> selectAll();

    List<Article> selectAllByBoardId(@Param("boardId") Long boardId);

    Article selectById(Long id);

    void updateLike(Long userId, Long articleId, Integer isLiked);

    Like selectByUserIdAndArticleId(Long userId, Long articleId);

    void insertLike(Long userId, Long articleId, Integer isLiked);

    List<Article> getArticleListByUserId(Long id);

    List<Article> getLikeArticleListByUserId(Long id);
}